<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body bgcolor="#b0e0e6">
<div id="app">
    <button v-on:click="show=!show">点点点</button>
    <h1 v-if="show">v-if</h1>
    <h1 v-show="show">v-show</h1>

    <h1 v-if="Math.random() > 0.5">
        看到我了 啦啦啦~~~
    </h1>
    <h6 v-else>
        看不到 看不到~~~
    </h6>

    <input type="text" v-model="message">
</div>

<script src="node_modules/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            show: true,
            message: ""
        },
        watch:{
            message(newVal, oldVal){
                console.log(newVal, oldVal);
            }
        }
    });
</script>

</body>
</html>